Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
MediaRecorder "onstop" event is fired twice in Safari

In my app, I'm using MediaRecorder to record a short video (up to 30s) from a user and then send it to the backend. To detect that recording has stopped, I use "onstop" event of MediaRecorder and in its callback I construct a video file and invoke uploading process. In Chrome and Edge it works fine. The event invokes only once, but in Safari I see different behavior, the "onstop" and "ondataavailable" events invoke twice. Therefore, my logic is broken, the backend receives two video files, the first one is broken usually, the second one is ok.

this.mediaRecorder = new MediaRecorder(stream, {
  mimeType,
  videoBitsPerSecond,
});

this.mediaRecorder.addEventListener('dataavailable', () => {
  console.debug('dataavailable');
});

this.mediaRecorder.addEventListener('stop', () => {
  console.debug('stop');
});

this.mediaRecorder.start();
console.debug('start');

Is this a bug of Safari or normal behavior?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Maybe you can create a own player with own stop-button and an onclick-event. eg.:

<video id=recoder></video>
<button onclick='document.getElementByID('recoder').pause()'>Stop/Pause</button>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda